<?php 
class IUser{
	
	public static $errCode;
	
	public static $errMsg;
	
	
	private static function clearERR(){
		self::$errCode = 0;
		self::$errMsg  = '';
	}
	
	public static function getLoginUid(){
		
		if( !isset( $_COOKIE['skey'] ) ){
			self::$errCode = 1001;
			self::$errMsg = "skey is empty";
			return false;
		} 
		
		return  $_COOKIE['skey'] === SESSION_TICKET ? 1 : 0;
		
	/*
		
		self::clearERR();
		
		if( !isset( $_COOKIE['skey'] ) ){
			self::$errCode = 1001;
			self::$errMsg = "skey is empty";
			return false;
		} 
		
		
		$db = Config::getDB();
		
		if( false === $db ){
			self::$errCode = Config::$errCode;
			self::$errMsg = Config::$errMsg;
			return false;
		}		
		
		$skey = $db->filterString( $_COOKIE['skey'] );
		$record = $db->getRows("select id from t_login where skey='" . $skey ."'");
		if( $record === false ){
			self::$errCode = $db->errCode;
			self::$errMsg = $db->errMsg;
			return false;
		}
	
		
		return count($record) > 0 ? $record[0]['id'] : false;
	*/}
	
}

?>